package com.hytc.mymall.activity.explain;

import android.app.DatePickerDialog;
import android.os.Bundle;
import android.view.View;
import android.widget.DatePicker;
import android.widget.ImageView;
import android.widget.ListView;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.hytc.mymall.R;
import com.hytc.mymall.adapter.ConsumptionSeriesAdapter;
import com.hytc.mymall.base.BaseActivity;

import java.util.Calendar;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

/**
 * Created by Administrator on 2016/12/8.
 */

public class ConsumptionSeriesActivity extends BaseActivity {
    @BindView(R.id.iv_title_left)
    ImageView ivTitleLeft;
    @BindView(R.id.rl_back)
    RelativeLayout rlBack;
    @BindView(R.id.toolbar_title)
    TextView toolbarTitle;
    @BindView(R.id.toolbar_title_arrow)
    ImageView toolbarTitleArrow;
    @BindView(R.id.rl_title)
    RelativeLayout rlTitle;
    @BindView(R.id.tv_right_selection)
    TextView tvRightSelection;
    @BindView(R.id.iv_right_arrowdown)
    ImageView ivRightArrowdown;
    @BindView(R.id.rl_right)
    RelativeLayout rlRight;
    @BindView(R.id.tv_consumptionseries_total)
    TextView tvConsumptionseriesTotal;
    @BindView(R.id.lv_consumptionseries)
    ListView lvConsumptionseries;
    Calendar calendar;
    ConsumptionSeriesAdapter adapter;

    @Override
    protected void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        setContentView(R.layout.activity_consumptionseries);
        ButterKnife.bind(this);
        initView();
    }

    /**
     * 初始化数据
     */
    private void initView() {
        rlBack.setVisibility(View.VISIBLE);
        toolbarTitle.setText("消费系列");

        adapter = new ConsumptionSeriesAdapter(this);
        lvConsumptionseries.setAdapter(adapter);
        calendar = Calendar.getInstance();
    }


    @OnClick({R.id.rl_back, R.id.rl_title, R.id.rl_right})
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.rl_title:
                break;
            case R.id.rl_back:
                finish();
                break;
            case R.id.rl_right:
                DatePickerDialog dialog = new DatePickerDialog(this, new DatePickerDialog.OnDateSetListener() {
                    @Override
                    public void onDateSet(DatePicker view, int year, int month, int dayOfMonth) {

                    }
                }, calendar.get(Calendar.YEAR), calendar.get(Calendar.MONTH), calendar.get(Calendar.DAY_OF_MONTH));
                dialog.show();
                break;
        }
    }
}
